package global.com.loansapplication.ui.actviity.user.biz;

import java.util.List;

import global.com.loansapplication.base.BaseBean;
import global.com.loansapplication.base.BaseBiz;
import global.com.loansapplication.base.BaseResp;
import global.com.loansapplication.bean.ClueInfo;
import global.com.loansapplication.comm.BaseSubscribe2;
import global.com.loansapplication.comm.RetrofitHelp;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

public class OwnerBiz extends BaseBiz {

    /**
     * 获取线索列表图
     *
     * @param callback
     */
    public void getClueList(String userCode, Integer pageNum, Integer pagesize, final BaseBiz.Callback<BaseBean<List<ClueInfo>>> callback) {
        com.add(RetrofitHelp.getSecretApi().myStudentList(userCode, pageNum, pagesize)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(new BaseSubscribe2<BaseResp<BaseBean<List<ClueInfo>>>>() {

                    @Override
                    public void onSuccess(Object obj) {
                        callback.onSuccess((BaseBean<List<ClueInfo>>)obj);
                    }

                    @Override
                    public void onFailure(Object obj) {
                        callback.onFailure((BaseBean<List<ClueInfo>>)obj);
                    }
                })
        );
    }

}
